import { validateNumber, validateInter, isMobile, isIdCard,hsaMn } from "@/util/rulesReg";
import { options } from '@/common';
export const group = [{
		label: '选择类型',
		icon: 'el-icon-edit-outline',
		column: [{
			label: '机器类型',
			prop: 'type',
			type: "select",
			span: 6,
			dataType:'number',
			disabled: false,
			dicUrl: "/api/blade-system/dict/dictionary?code=highrisk_device_type",
			props: {
				label: "dictValue",
				value: "dictKey"
			},
			rules: [{
				required: true,
				message: "请选择机器类型",
				trigger: "blur"
			}]
		}]
	},
	{
		label: '参数配置',
		icon: 'el-icon-edit-outline',
		column: [{
				label: '设备名称',
				prop: 'deviceName',
				span: 6,
				rules: [{
					required: true,
					message: "请输入设备名称",
					trigger: "blur"
				}]
			},
			{
				label: '厂家名称',
				prop: 'ownerName',
				span: 6,
				rules: [{
					required: true,
					message: "请输入设备厂家名称",
					trigger: "blur"
				}]
			},
			{
				label: '设备类型',
				prop: 'deviceType',
				span: 6,
				rules: [{
					required: true,
					message: "请输入设备类型",
					trigger: "blur"
				}]
			},
			{
				label: '终端编号',
				prop: 'deviceId',
				span: 6,
				rules: [{
					required: true,
					message: "请输入终端编号",
					trigger: "blur"
				}]
			},
			{
				label: '塔机工作臂长(米)',
				labelWidth: 140,
				prop: 'limitMagnitude',
				placeholder: '请输入臂长',
				span: 6,
				rules: [{
					validator: validateNumber,
					trigger: 'blur',
					required: true
				}]
			},
			{
				label: '额定重量(吨)',
				labelWidth: 105,
				prop: 'limitWeight',
				span: 6,
				rules: [{
					validator: validateNumber,
					trigger: 'blur',
					required: true
				}]
			},
			{
				label: '额定力矩(吨*米)',
				labelWidth: 125,
				prop: 'limitTorque',
				placeholder: '请输入力矩',
				span: 6,
				rules: [{
					validator: validateNumber,
					trigger: 'blur',
					required: true
				}]
			},
			{
				label: '塔机高度(米)',
				labelWidth: 105,
				prop: 'limitHeight',
				placeholder: '请输入塔机高度',
				span: 6,
				rules: [{
					validator: validateNumber,
					trigger: 'blur',
					required: true
				}]
			},
			{
				label: '平面图x坐标',
				labelWidth: 110,
				prop: 'posx',
				placeholder: '请输入x坐标',
				span: 6,
				rules: [{
					validator: validateInter,
					trigger: 'blur',
					required: true
				}]
			},
			{
				label: '平面图y坐标',
				labelWidth: 110,
				prop: 'posy',
				placeholder: '请输入y坐标',
				span: 6,
				rules: [{
					validator: validateInter,
					trigger: 'blur',
					required: true
				}]
			},
			{
				label: '站点名称',
				prop: 'siteInfoName',
				span: 6,
				disabled: true,
				value:'',
				rules: [{
					required: true,
					message: "请输入站点名称",
					trigger: "blur"
				}]
			},
			{
				label: 'mn号',
				prop: 'mn',
				span: 6,
				rules: [{
					required: true,
					message: "请输入mn号",
					trigger: "blur"
				}]
			},
			{
				label: '驾驶员',
				prop: 'staffId',
				span: 6,
				type: "select",
				dicUrl: "/api/squirrel-ficm/highriskdeviceinfo/getStaffList",
				props: {
					label: "name",
					value: "id"
				}
			},
            {
              label: '平面图',
              prop: 'map',
              span: 24,
              hide: true,
              formslot: true,
              display: false
            }
		]
	}
]

export const column = [{
		label: '设备名称',
		prop: 'deviceName',
		search: true,
		display: false
	},
	{
		label: '厂家名称',
		prop: 'ownerName',
		display: false
	},
	{
		label: '类型',
		prop: 'type',
		search: true,
		type: "select",
		dataType: "number",
		display: false,
		dicUrl: "/api/blade-system/dict/dictionary?code=highrisk_device_type",
		props: {
			label: "dictValue",
			value: "dictKey"
		}
	},
	{
		label: '终端编号',
		prop: 'deviceId',
		width: 150,
		display: false
	},
	{
		label: 'mn号',
		width: 150,
		prop: 'mn',
		display: false
	},
	{
		label: "驾驶员",
		display: false,
		labelWidth: 120,
		prop: "staffId",
		type: "select",
		dicUrl: "/api/squirrel-ficm/highriskdeviceinfo/getStaffList",
		props: {
			label: "name",
			value: "id"
		},
    formatter: (row, value, label, column) => {
      if(!value) {
        return '-'
      } else {
        return value
      }
    },
	},
	{
		label: '平面图x坐标',
		prop: 'posx',
		width: 120,
		align: options.$tabelAlgin,
    formatter: (row, value, label, column) => {
      if(!value) {
        return '-'
      } else {
        return value
      }
    },
		display: false
	},
	{
		label: '平面图y坐标',
		prop: 'posy',
		width: 120,
		align: options.$tabelAlgin,
    formatter: (row, value, label, column) => {
      if(!value) {
        return '-'
      } else {
        return value
      }
    },
		display: false
	},
	{
		label: '额定重量(吨)',
		width: 120,
		prop: 'limitWeight',
		align: options.$tabelAlgin,
		formatter: (row, value, label, column) => {
			if(!value) {
				return '-'
			} else {
				return value
			}
		},
		display: false
	},
	{
		label: '额定力矩(吨*米)',
		width: 120,
		prop: 'limitTorque',
		align: options.$tabelAlgin,
		formatter: (row, value, label, column) => {
			if(!value) {
				return '-'
			} else {
				return value
			}
		},
		display: false
	},
	{
		label: '塔机高度(米)',
		width: 120,
		prop: 'limitHeight',
		align: options.$tabelAlgin,
		formatter: (row, value, label, column) => {
			if(!value) {
				return '-'
			} else {
				return value
			}
		},
		display: false
	},
	{
		label: '塔机工作臂长(米)',
		width: 120,
		prop: 'limitMagnitude',
		align: options.$tabelAlgin,
		formatter: (row, value, label, column) => {
			if(!value) {
				return '-'
			} else {
				return value
			}
		},
		display: false
	}
]
